namespace Digitalmes.Infrastructure.MQ.Mqtt;

/// <summary>
/// MQTT 客户端。
/// </summary>
public interface IMQTTClient : IDisposable
{
    /// <summary>
    /// 发布消息。
    /// </summary>
    /// <param name="topic">topic</param>
    /// <param name="payload">要发布的消息</param>
    /// <param name="retain">服务端是否要保留消息</param>
    /// <param name="cancellationToken"></param>
    /// <returns></returns>
    Task<bool> PublishStringAsync(string topic, string payload, bool retain = false, CancellationToken cancellationToken = default);
}
